home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 64
/
Volume 64 - JOGO DISK .iso
/
Games
/
the_best_every_day.swf
/
scripts
/
__Packages
/
Game.as
< prev
next >
Wrap
Text File
|
2008-04-10
|
5KB
|
163 lines
class Game
{
function Game(l_mcGame)
{
trace("-----------------------------------------------");
trace("Level = " + _global.Pack.nLevel);
this.mcGame = l_mcGame;
this.bGamePlaying = true;
this.bMiniGame = false;
var _loc3_ = _global.Pack.nLevel;
while(_loc3_ > 5)
{
_loc3_ -= 5;
}
this.mcGame.gotoAndStop("Level" + _loc3_);
this.oLevel = new Level(_global.Pack.nLevel,this.mcGame);
this.nMiniFunds = Number(830 - 30 * _global.Pack.nLevel);
this.nTimeBetweenMG = Number(1220 - 20 * _global.Pack.nLevel);
if(this.nTimeBetweenMG < 400)
{
this.nTimeBetweenMG = 400;
}
if(this.nMiniFunds < 150)
{
this.nMiniFunds = 150;
}
this.nTempFund = _global.Pack.nFunds;
this.nTempIncome = 0;
this.nTempSpend = 0;
this.AjustScore(0,"Funds");
this.AjustScore(0,"Score");
_global.Pack.unPauseGame();
trace("nFunds per miss = " + Number(450 + _global.Pack.nLevel * 50));
trace("pay Per miniGame = " + this.nMiniFunds);
trace("time Between miniGame = " + this.nTimeBetweenMG);
trace("-----------------------------------------------");
}
function update()
{
if(!_global.Pack.bPaused)
{
this.oLevel.update();
this.mcMiniGame.update();
}
}
function addLadder(l_mcLadder)
{
this.oLevel.addLadder(l_mcLadder);
}
function addFloor(l_mcFloor)
{
this.oLevel.addFloor(l_mcFloor);
}
function addDropPoint(l_mcDropPoint)
{
this.oLevel.addDropPoint(l_mcDropPoint);
}
function addPatrick(l_mcPatrick)
{
this.oLevel.addPatrick(l_mcPatrick);
}
function addObstacle(l_mcObstacle, l_sType)
{
this.oLevel.addObstacle(l_mcObstacle,l_sType);
}
function removeObstacle(l_mcObstacle)
{
this.oLevel.removeObstacle(l_mcObstacle);
}
function dropBox(l_bCorrect)
{
this.oLevel.dropBox(l_bCorrect);
if(!l_bCorrect)
{
this.AjustScore(Number(-450 - _global.Pack.nLevel * 50),"Funds");
}
else
{
this.AjustScore(Number(450 + _global.Pack.nLevel * 50),"Score");
}
}
function createLevel()
{
_global.Transition.play();
_global.Transition.TransFunc = function()
{
_global.Pack.nLevel = _global.Pack.nLevel + 1;
_global.GS.gotoAndStop("Game");
};
}
function AjustScore(_Txt, _Kind)
{
var _loc4_ = 0;
if(_Kind == "Score")
{
_global.Pack.nScore += _Txt;
this.mcGame.Hud.nScore_txt.text = _global.Pack.nScore;
}
else
{
_global.Pack.nFunds += _Txt;
if(_global.Pack.nFunds < 0)
{
this.EndGame(false);
this.mcGame.Hud.nFunds_txt.text = "$ 0";
}
else
{
this.mcGame.Hud.nFunds_txt.text = "$ " + _global.Pack.nFunds;
}
if(_Txt > 0)
{
this.nTempIncome += _Txt;
}
else
{
this.nTempSpend -= _Txt;
}
}
}
function EndGame(p_bSuccces)
{
this.bGamePlaying = false;
this.oLevel.oPatrick.ClearControls();
this.mcGame.FinishScreen.gotoAndPlay("appear");
if(p_bSuccces)
{
this.AjustScore(1000,"Funds");
if(!_global.Pack.bBonus)
{
this.mcGame.FinishScreen.Table.gotoAndStop(1);
}
else
{
this.mcGame.FinishScreen.Table.gotoAndStop(2);
}
}
else
{
_global.MiniGame.ClearControls();
if(_global.MiniGame._parent._currentframe != 1)
{
_global.MiniGame._parent.gotoAndPlay("disapear");
}
this.mcGame.FinishScreen.Table.gotoAndStop(3);
}
_global.Pack.pauseGame();
}
function pasteInfo(p_mcMovie)
{
p_mcMovie.nLevel_txt.text = _global.Pack.nLevel;
p_mcMovie.StartFunds_txt.text = "$ " + this.nTempFund;
p_mcMovie.FundsEarn_txt.text = "$ " + this.nTempIncome;
p_mcMovie.FundsSpend_txt.text = "$ " + this.nTempSpend;
if(_global.Pack.bBonus)
{
_global.Pack.nFunds += 100;
this.mcGame.Hud.nFunds_txt.text = "$ " + _global.Pack.nFunds;
}
p_mcMovie.Remain_txt.text = "$ " + _global.Pack.nFunds;
}
}